Non-Linear Pattern-Matching against Unfree Data Types with Lexical Scoping
نویسنده
چکیده
This paper proposes a pattern-matching system that enables nonlinear pattern-matching against unfree data types. The system allows multiple occurrences of the same variables in a pattern, multiple results of pattern-matching and modularization of the way of pattern-matching for each data type at the same time. It enables us to represent patternmatching against not only algebraic data types but also unfree data types such as sets, graphs and any other data types whose data have no canonical form and multiple ways of decomposition. I have realized that with a rule that pattern-matching is executed from the left side of a pattern and a rule that a binding to a variable in a pattern can be referred to in its right side of the pattern. Furthermore, I have realized modularization of these patterns with lexical scoping. In my system, a pattern is not a first class object, but a pattern-function that obtains only patterns and returns a pattern is a first class object. This restriction simplifies the non-linear pattern-matching system with lexical scoping. I have already implemented the pattern-matching system in the Egison programming language.
منابع مشابه
Egison: Non-Linear Pattern-Matching against Non-Free Data Types
This paper introduces the Egison programming language whose feature is strong pattern-matching facility against not only algebraic data types but also non-free data types whose data have multiple ways of representation such as sets and graphs. Our language supports multiple occurrences of the same variables in a pattern, multiple results of pattern-matching, polymorphism of pattern-constructors...
متن کاملLexical Scoping as Universal Quantification
A universally quantified goal can be interpreted intensionally, that is, the goal ∀x.G(x) succeeds if for some new constant c, the goal G(c) succeeds. The constant c is, in a sense, given a scope: it is introduced to solve this goal and is "discharged" after the goal succeeds or fails. This interpretation is similar to the interpretation of implicational goals: the goal D ⊃ G should succeed if ...
متن کاملNative and Non-native Use of Lexical Bundles in Discussion Section of Political Science Articles
The study of lexical bundles, among types of text analysis, is gaining importance over the others in the last century. The present study employed a frequency-based analysis approach to the use of lexical bundles. The discussion section of 60 political science articles, with corpora around 253,063 words were investigated in three aspects of structure, form, and function of lexical bundles. The p...
متن کاملFrom ML to C via Modula-3 an approach to teaching programming
types: Types can be defined in terms of permitted operations while keeping implementation details private. Static scoping: All identifiers are resolved at compile time. However, procedure execution can be controlled by pattern matching of arguments at run time. Type-safe exceptions: Exceptions allow procedures to return out-of-band results (often arising from abnormal conditions) to be communic...
متن کامل2 Cml Overview
Both the implementation and the user’s view of eXene rely heavily on the concurrency model provided by CML . CML is based on the sequential language SML[MTH90, MT91] and inherits the following good features of SML: functions as first-class values, strong static typing, polymorphism, datatypes and pattern matching, lexical scoping, exception handling and a state-of-the-art module facility. The s...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1407.0729 شماره
صفحات -
تاریخ انتشار 2014